package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.CallAplanInfoDto;
import com.crm.jdy.common.dto.ClientChargeInfoDto;
import com.crm.jdy.common.mapper.ClientChargeInfoMapper;
import com.crm.jdy.common.pojo.CallAplanInfo;
import com.crm.jdy.common.mapper.CallAplanInfoMapper;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(拜访活动计划服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class CallAplanInfoServiceImpl  extends ServiceImpl<CallAplanInfoMapper,CallAplanInfo> implements CallAplanInfoService  {

    @Autowired
    CallAplanInfoMapper callAplanInfoDao;

    @Override
    public PageInfo<CallAplanInfo> seleteCallAplanInfo(CallAplanInfoDto activityInfo) {
        PageHelper.startPage( activityInfo.getCurrentPage(),activityInfo.getPageSize());
        List<CallAplanInfo> bookList = callAplanInfoDao.seleteClientInfo(activityInfo);
        PageInfo<CallAplanInfo> pageInfo = new PageInfo<CallAplanInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateCallAplanInfo(CallAplanInfo callAplanInfoDto) {
        return callAplanInfoDao.updateById(callAplanInfoDto) > 0;
    }

    @Override
    public boolean addCallAplanInfo(CallAplanInfo callAplanInfo) {
        return callAplanInfoDao.insert(callAplanInfo) > 0;
    }

    @Override
    public boolean removeCallAplanInfo(String aplanId) {
        return callAplanInfoDao.deleteById(aplanId) > 0;
    }

}